{extend name="base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/mmgrid/mmGrid.css?v={$v}" />
{/block}
{block name="js"}
<script src="__STATIC__/plugins/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
<script src="__STATIC__/plugins//kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script>
<script src="__ADMIN__/articles/guide.js?v={$v}" type="text/javascript"></script>
<script>
$(function(){initGrid({$p});})
</script>
{/block}
{block name="main"}
<div class="layui-tab layui-tab-brief" lay-filter="msgTab">
  <ul class="layui-tab-title">
    <li class="layui-this">入驻指南</li>
    <li >入驻协议</li>
  </ul>
  <div class="layui-tab-content" >
    <div class="layui-tab-item layui-show">
		<div class="wst-toolbar">
		   <input type='text' id='key' placeholder='标题'/> 
		   <button class="btn btn-primary" onclick='javascript:loadGrid()'><i class='fa fa-search'></i>查询</button>
		   {if WSTGrant('RZZN_03')}
		   <button class="btn btn-danger f-right btn-fixtop" onclick='javascript:toBatchDel()' style='margin-left:10px;'><i class='fa fa-trash'></i>批量删除</button>
		   {/if}
		   {if WSTGrant('RZZN_01')}
		   <button class="btn btn-success f-right btn-fixtop" onclick='javascript:toEdit(0)'><i class='fa fa-plus'></i>新增</button>
		   {/if}
		   <div style='clear:both'></div>
		</div>
		<div class='wst-grid'>
		<div id="mmg" class="mmg"></div>
		<div id="pg" style="text-align: right;"></div>
		</div>
    </div>
    <div class="layui-tab-item">
        <input type='hidden' id='articleId' value='{$object["articleId"]}'/>
		<form id='articleForm' autocomplete="off">
		<table class='wst-form wst-box-top '>
		   <tr>
		       <td align='center'>入驻协议</th>
		   </tr>
		       <td align='center'>
		       	{if WSTGrant('RZZN_02')} 
		       	<textarea id='articleContent' name='articleContent' class="form-control ipt" style='width:80%;'>{$object['articleContent']}</textarea>
		       	{else}
		       	<div style='width:80%;text-align:left;'>
                {$object['articleContent']|htmlspecialchars_decode}
                <div>
		       	{/if}
		       </td>
		    </tr>
		    {if WSTGrant('RZZN_02')}
		    <tr>
		       <td align='center'>
		       	<button type="button" class="btn btn-primary btn-mright" onclick="javascript:saveAgreement()"><i class="fa fa-check"></i>保&nbsp;存</button> 
		        <button type="button" class="btn" onclick="javascript:clearHtml()"><i class="fa fa-refresh"></i>清&nbsp;除</button>
		       </td>
		    </tr>
		    {/if}
		</table>
    </div>
  </div>
</div>
{if WSTGrant('RZZN_02')} 
<script>
var editor1 = null;
$(function(){
  //编辑器
    KindEditor.ready(function(K) {
		editor1 = K.create('textarea[name="articleContent"]', {
			height:'600px',
            uploadJson : WST.conf.ROOT+'/admin/articles/editorUpload',
			allowFileManager : false,
			allowImageUpload : true,
            allowMediaUpload : false,
			items:[
			        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
			        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
			        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
			        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
			        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
			        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','media','table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
			        'anchor', 'link', 'unlink', '|', 'about'
			],
			afterBlur: function(){ this.sync(); }
		});
	});
});
function clearHtml(){
    editor1.html("");
}
</script>
{/if}
{/block}